<?php
include_once("common/init.php");
$tb_name = "collect";
if (!$_SESSION["id"]) {
		goBakMsg("登录后才可收藏");
		die;
	}
$row = db_get_row("select * from $tb_name where userid='". $_SESSION["id"] ."' and content1id=". $_REQUEST["id"] ."");
if ($row["id"]) {
	goBakMsg("你已经收藏过！！");
	die;
}
$data = array();
$data["userid"] = "'". $_SESSION["id"] ."'";
$data["content1id"] = "'". $_REQUEST["id"] ."'";
db_add($tb_name, $data);
goBakMsg("收藏成功");
die;
?>